<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>workerman实战layIM-lampol</title>
	<link rel="stylesheet" type="text/css" href="/static/login/css/util.css">
	<link rel="stylesheet" type="text/css" href="/static/login/css/main.css">
	<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
</head>

<body>

	<div class="limiter">
		<div class="container-login100" style="background-image: url('/static/login/css/bg-01.jpg');">
			<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
				<form action="javascript:;" class="login100-form validate-form">
					<span class="login100-form-title p-b-49">登录</span>

					<div class="wrap-input100 validate-input m-b-23" data-validate="请输入用户名">
						<span class="label-input100">用户名</span>
						<input class="input100" type="text" id="username" name="username" placeholder="请输入用户名" autocomplete="off">
						
					</div>

					<div class="wrap-input100 validate-input" data-validate="请输入密码">
						<span class="label-input100">密码</span>
						<input class="input100" type="password" id="password" name="pass" placeholder="请输入密码">
						
					</div>

					<div class="text-right p-t-8 p-b-31">
						<a href="javascript:">忘记密码？</a>
					</div>

					<div class="container-login100-form-btn">
						<div class="wrap-login100-form-btn">
							<div class="login100-form-bgbtn"></div>
							<button id="login" class="login100-form-btn">登 录</button>
						</div>
					</div>

				</form>
			</div>
		</div>
	</div>

</body>

</html>
<script>
	$("#login").click(function () {
		var username = $("#username").val();
		var password = $("#password").val();
		$.post('/login',{username:username,password:password},function (res) {
			console.log(res);
			if(res.status==='success'){
				location.href="/chat/"+res.token;
			}else{
				alert(res.msg);
			}
		});
	});

</script>